<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" 
CodeBehind="SyntaxHighlighter.aspx.cs" 
Inherits="SharpPieces.DemoApp.syntaxhighlighter" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headPlaceHolder" runat="server">
    <title>SharpPieces - SyntaxHighlighter - Live Demo</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="descriptionPlaceholder" runat="server">
    <h1>SyntaxHighlighter</h1>
    
    <p>SharpPieces SyntaxHighlighter ASP.NET Control is based on the excellent javascript library 
SyntaxHighlighter available <a title="SyntaxHighlighter" rel="nofollow" 
href="http://code.google.com/p/syntaxhighlighter/">here</a>.</p>

    <p>SharpPieces SyntaxHighlighter supports: C/C++, C#, Css, Delphy, Java, JavaScript, PHP, 
    Python, Ruby, SQL, VB/VB.NET, XML/HTML/ASPX.</p>
    
    <p>Below you'll find some examples for few of the languages above.</p>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="demoPlaceholder" runat="server">
    <h2>SharpPieces SyntaxHighlighter using C# code</h2>
    <piece:SyntaxHighlighter ID="highlighter" Collapsed="false" FirstLine="1" ShowColumns="false" 
    ShowControls="true" ShowGutter="true" runat="server" Language="cSharp">
        <ContentTemplate>
        //based on http://code.google.com/p/syntaxhighlighter/
        string template;
        private bool _embeddedStyleSheet;
        private Language _language;

        public SyntaxHighlighter() : base("pre")
        {
            this.Init += new EventHandler(SyntaxHighlighter_Init);
            this.PreRender += new EventHandler(SyntaxHighlighter_PreRender);

            EmbeddedStyleSheet = true;
        }
        </ContentTemplate>
    </piece:SyntaxHighlighter>
    
    <h2>SyntaxHighlighter using ASPX/html markup</h2>
    <piece:SyntaxHighlighter ID="aspx" runat="server" Language="xml">
        <ContentTemplate>
        <piece:ImageCheckBox ID="chkPostback" Text="Do a postback!" runat="server" 
                OnClientBeforeChange="CheckPrevent" AutoPostBack="true" />
<piece:ImageCheckBox ID="chkPreventPostback" Text="Prevent postback?" 
                runat="server" ></piece:ImageCheckBox>
        </ContentTemplate>
    </piece:SyntaxHighlighter>
    
    <h2>SyntaxHighlighter using JavaScript code</h2>
    <piece:SyntaxHighlighter ID="js" runat="server" UseTextArea="true" Language="javascript">
        <ContentTemplate>
            function CheckPrevent(checkboxInstance) {
                if(document.getElementById(someControl._checkValueID).value == "1") {
                    alert("Sorry, no postback");
                    return false;
                }
                return true;
            }
        </ContentTemplate>
    </piece:SyntaxHighlighter>
    
    <h2>SyntaxHighlighter using CSS</h2>
    <piece:SyntaxHighlighter ID="css" runat="server" Language="css">
        <ContentTemplate>
            /*
	            Keep this file synchronized with the one from Demo.
            */

            html,body,form
            {
	            margin: 0px;
	            padding: 0px;
	            background-color: #373B44;
	            text-align: center;
	            font-family:Verdana;
	            font-size:13px;
            }
        </ContentTemplate>
    </piece:SyntaxHighlighter>
</asp:Content>
